﻿using System;
using System.Collections.Generic;

using RexToy.UI.WinForm;
using RexToy.UI.WinForm.Pmlx;
using RexToy.UI.WinForm.ViewModel;

using Studio.Model;

namespace Studio.ViewModel
{
    public class FrmTemplateDesignerVM : ViewModelBase
    {
        private static int _ID = 0;

        private int _id;
        public int Id
        {
            get { return _id; }
        }

        public FrmTemplateDesignerVM()
        {
            _ID++;
            _id = _ID;
        }

        private FrmMainVM _mainVM;
        public void SetMainVM(FrmMainVM vm)
        {
            _mainVM = vm;
        }

        protected override void Closing()
        {
            _mainVM.RemoveDesigner(this);
        }

        private TemplateEditVM _editVM;
        public void SetEditorVM(TemplateEditVM vm)
        {
            _editVM = vm;
        }

        public void SetDbContext(IDatabaseModel dbModel)
        {
            _editVM.SetDbModel(dbModel);
        }
    }
}
